package animation;

import java.util.Iterator;
import java.util.LinkedList;

public class AnimationFrameListImpl extends LinkedList<AnimationFrame> implements AnimationFrameList {

	private static final long serialVersionUID = 1L;

	@Override
	public void addFrame(AnimationFrame frame) {
		this.addLast(frame);
	}

	@Override
	public int getAnimationTime() {
		int ret = 0;
		for(AnimationFrame f : this)
		{
			ret += f.getDelay();
		}
		return ret;
	}

	@Override
	public int getNumberFrames() {
		return this.size();
	}

	@Override
	public void removeAll() {
		this.clear();

	}

	@Override
	public Iterator<AnimationFrame> iterator() {
		return super.iterator();
	}

}
